import java.util.HashMap;

import expressoes.Constante;
import expressoes.Expressao;
import expressoes.Not;
import expressoes.Or;
import expressoes.Variavel;


public class TesteExpressoes {
	
	public static void main(String[] args) {
		
		HashMap<String, String> valoracao = new HashMap<String, String>();
		valoracao.put("x", "1");
		valoracao.put("y", "0");
		valoracao.put("z", "1");
		
//		Expressao exp = new Variavel("x");
//		Expressao exp = new Constante("0");
//		Expressao exp = new Not(new Variavel("x"));
//		Expressao exp = new Not(new Constante("1"));
//		Expressao exp = new Or(new Not(new Variavel("x")), new Variavel("y"));
		Expressao exp = new Or(new Or(new Variavel("x"), new Variavel("y")), new Not(new Variavel("z")));
		
		System.out.println("Expressao " + exp.getExpressao());
		
		
		System.out.print("SubExpressoes: ");
		for(String sub : exp.getSubExpressoes()){
			System.out.print(sub + ",");
		}
		System.out.println();
		
		System.out.println("Calculo " + exp.calcula(valoracao));
	}
	
}
